package com.jzy.gulimall.order.config;

import com.jzy.gulimall.order.interceptor.UserLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author jzy
 * @date 2020/9/20 15:42
 */
@Configuration
public class OrderWebConfig implements WebMvcConfigurer {

    @Resource
    private UserLoginInterceptor userLoginInterceptor;

    //库存服务调用订单服务,库存服务没有feign拦截器,远程调用丢失请求头,直接排除一下
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userLoginInterceptor).excludePathPatterns("/order/order/status/**","/payed/notify");
    }
}
